A method and device for superimposing depth of field of a translucent target object to remove halo interference
By replacing the coordinate positions of halos and translucent targets in the microscope image sequence, the problem of halo interference in multiple image sequences under the microscope is solved, and the effect of depth of field superposition and the display of target characteristics are improved.
Patent Information
- Application Number
- CN202410383311.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-04-01
AI Technical Summary
Existing technology is difficult to effectively remove halo interference in multiple image sequences of light-transmitting targets under a microscope, resulting in invalid information being added to the depth-of-field superposition results, affecting display clarity and observation of target characteristics.
By acquiring an aligned microscope image sequence, an artificial intelligence detection algorithm is used to determine the coordinate positions of the halo and translucent target, replace the area of interest, and perform depth-of-field superposition to remove the halo and restore the original image.
It improves the imaging effect of depth-of-field superposition, reduces the addition of invalid information, significantly reflects the characteristics of the original target, and enhances the reliability of subsequent observation and detection.
Smart Images

Figure CN118115486B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a method and device for superimposing depth of field of a light-transmitting target object for removing halo interference. Background Art
[0002] Microscopes are one of the most commonly used medical equipment, and phase contrast microscopes are one type of microscopes, which are often used to observe cells, bacteria and other targets in specimens on unstained slides. Because when applying specimens on slides, it is often impossible to achieve uniform thickness or the thickness of different targets in the specimens is different, or different targets are at different focal depths of field, so when observing some targets, only one focal plane needs to be adjusted, but some targets need to adjust multiple focal planes to observe different information at different focal planes. Therefore, the depth of field superposition of microscope image sequences has always been an important research topic, which can help microscope operators observe information at different depths of field on the same image at the same time.
[0003] For some targets under phase contrast microscope, light transmittance is an important feature and an important indicator for operators to determine their categories. However, due to reasons such as light diffraction, light-transmitting targets will produce different degrees of halo phenomena on different focal planes, and the generated halo is not effective target information. Existing depth of field superposition methods, such as those based on Laplace pyramid decomposition or wavelet decomposition, all input the original image information for superposition, so the result of the depth of field superposition will add a lot of invalid information and noise, affecting the clarity of the display results and interfering with the observation of the original characteristics of the target.
[0004] A Chinese invention patent with publication number CN 111192218A discloses an "image processing method and device, electronic device and storage medium". The method obtains a first image based on an image to be processed; obtains a mask image of the image to be processed based on the pixel values of each pixel point of the image to be processed; and fuses the image to be processed and the first image based on the mask image to obtain a de-haloated image.
[0005] The Chinese invention patent with publication number CN 111127358A discloses an "image processing method, device and storage medium", which obtains the position information of the light source object by detecting the position of the light source object in the target image; performs dehalation processing on the light source image indicated by the position information to obtain the dehalated light source image.
[0006] Although the above two invention patents disclose methods for obtaining de-haloed images, both of them propose methods for removing halos for a single image. The halo generated by the translucent target involved in this application has completely covered the size and other characteristics of the original target, so it is impossible to restore the morphological characteristics of the original translucent target that produces the halo phenomenon through a single image. In view of the shortcomings of the prior art and the special scenario of translucent targets under phase contrast microscopes, a method is developed to remove the halo of translucent targets in a sequence of several microscopic images and restore them to the original image, so as to improve the imaging effect of depth of field superposition, reduce the addition of invalid information, more effectively reflect the characteristics of the original target, and provide guarantees for the subsequent observation and detection of targets. Summary of the invention
[0007] The technical problem to be solved by the present invention is to overcome the above-mentioned defects of the prior art and provide a method and device for removing halo interference from a translucent target object depth of field superposition. Through this method and device, the translucent target objects in a sequence of several microscopic images are removed from the halo and restored to the original image, so as to improve the imaging effect of depth of field superposition, reduce the addition of invalid information, more effectively reflect the characteristics of the original target object, and provide guarantee for the subsequent observation and detection of the target object.
[0008] The present invention is achieved through the following technical solutions:
[0009] A method for removing halo interference from a translucent target object depth of field superposition comprises the following steps:
[0010] S1: Acquire an alignment target image sequence: collect a number of target images with different depths of field under the same field of view of the microscope to obtain a target image sequence. After the alignment operation, an alignment target image sequence is obtained. The target images include halo targets and translucent targets.
[0011] S2: Detecting the coordinate position of the target object: using an artificial intelligence target detection algorithm to detect the coordinate position of the halo target and the translucent target in each image of the aligned target image sequence, obtaining the position information of the halo target and the translucent target, and obtaining the full set of halo targets and the full set of translucent targets in each image, wherein the sum of the number of halo targets and translucent targets in each image of the aligned target image sequence is equal;
[0012] S3: Detecting the halo target generated by the same translucent target in the alignment target image sequence, and obtaining the corresponding relationship between the area at the position coordinates of the halo element target with the largest area and its position index and the corresponding relationship between the area at the position coordinates of the translucent target with the smallest area and its position index;
[0013] S4: replacing the region of interest at the coordinates in all images in the aligned target image sequence with the region of interest of the light-transmitting element target with the smallest area, to obtain an image sequence after the region of interest is replaced; the coordinate position of the region of interest of the light-transmitting target with the smallest area uses the coordinate position of the corresponding halo target with the largest area;
[0014] S5: Perform depth of field superposition using the image sequence after replacing the region of interest to obtain a final target image that removes the halo and restores the original image.
[0015] As an optimization, S3 specifically includes the following steps:
[0016] S31: Union the entire set of halo targets in each image in S2 to generate a total set of all halo targets, and obtain a position index relationship corresponding to each halo target;
[0017] S32: Union the entire set of translucent objects in each image in S2 to generate a total set of all translucent objects, and obtain a position index relationship corresponding to each translucent object;
[0018] S33: Calculating the center point coordinates of each halo target in the total set of halo targets in S31 and the center point coordinates of each translucent target in the total set of translucent targets in S32;
[0019] S34: separating the total set of halo target objects in S31 into multiple halo target object subsets, and obtaining a corresponding relationship between position indexes of elements in each halo target object subset, wherein elements in the same halo target object subset are related, and elements between any two different halo target object subsets are not related;
[0020] S35: obtaining the correspondence between the halo target with the largest area in each halo target subset and its position index by comparing and calculating the coordinates of the center points of the halo targets in S33;
[0021] S36: constructing an original light-transmitting target object subset corresponding to the halo target with the largest area in each halo target object subset described in S35;
[0022] S37: Obtain the corresponding relationship between the transparent target object with the smallest area in each original transparent target object subset and its position index through comparative calculation of the center point coordinates of the transparent target objects in S33.
[0023] As an optimization, S1 collects N image sequences with different focal lengths and equal image resolution in the same field of view, which are set as images = {image1, image2, ..., image n ,…,image N-1,image N}, N ≥ 2, where image n It is represented as the nth image in the image sequence, and the image resolution is set as H×W, where H represents the height of the image and W represents the width of the image.
[0024] As an optimization, S1 adjusts the coarse and fine focus of the microscope to capture images of different focal lengths in the same field of view. In this process, the image sequence collected will have pixel-level shifts and geometric transformations such as affine transformations for the same target object at different focal lengths. Therefore, if image alignment is not performed and the depth of field of the images is directly superimposed, obvious ghosting will occur, resulting in blurry and unclear effects after superposition. The goal of image alignment for image sequences is to ensure that the same target object is at the same pixel position in the image sequence. Because the same target object displays different features at different focal lengths, the feature point matching algorithm cannot be used for alignment. Instead, the enhanced correlation analysis parameter maximization algorithm is used for image alignment. The image sequence after image alignment is set as imgs={img1,img2,…,img n ,…,img N-1 ,img N}.
[0025] As an optimization, the specific steps of S2 are:
[0026] Construct a training set for detecting halos and translucent objects, train an artificial intelligence detection model, and use the detection model to detect halos and their corresponding translucent objects in the aligned image sequence imgs. Set the nth image img in the image sequence imgs n Detected Halo targets and A light-transmitting target.
[0027] a) For image img n , 1≤n≤N, the coordinate position set of the detected halo target is set as
[0028]
[0029] in, The pth (n) The element target is For a fixed n, p (n) The value range is Right now For any n and p (n) , satisfying 1≤n≤N, Set as
[0030]
[0031] Among them, setting For the nth image, the pth (n) The horizontal coordinate of the upper left corner of the halo target is set The pth image in the nth image (n) The vertical coordinate of the upper left corner of the halo target, set The pth image in the nth image (n) The horizontal coordinate of the lower right corner of the halo target is set For the nth image, the pth (n) The vertical coordinate of the lower right corner of the halo target.
[0032] b) For image img n , 1≤n≤N, the set of coordinate positions of the translucent target is recorded as
[0033]
[0034] in, The qth (n) The goal is For a fixed n, q n The value range is Right now For any n(1≤n≤N) Set as
[0035]
[0036] Among them, setting is the qth (n) The horizontal coordinate of the upper left corner of the translucent target object is set is the qth (n) The ordinate of the upper left corner of a translucent target object is set is the qth (n) The horizontal coordinate of the lower right corner of the translucent target object is set is the qth (n) The ordinate of the lower right corner of a translucent target object.
[0037] Because the halo target is a phenomenon caused by the translucent target at different focal lengths, there is a one-to-one correspondence between the halo target and the translucent target. Therefore, for any n1∈[1,N],n2∈[1,N], and n1 and n2 are integers,
[0038]
[0039] That is, the sum of the number of halo objects and translucent objects in each image in the image sequence is equal.
[0040] The total number of halos and translucent objects in the nth image is set to
[0041]
[0042] So, set Number = Number (n) , that is, Number is the sum of the number of halo targets and translucent targets in each image.
[0043] As an optimization, the total set calculation formula of all halo targets in S31 is:
[0044]
[0045] in, is the total set of all halo targets, is the complete set of halo targets in the nth image, N is the number of images in the alignment target image sequence, 1≤n≤N;
[0046] The position index relationship corresponding to each halo target is:
[0047]
[0048] Among them, h represents the total set The hth element in n h Represents the nth image in the alignment target image sequence h Zhang Tu, For the Halo targets, 1≤n h ≤ N, Representative Complete Works The number of elements in .
[0049] As an optimization, the total set calculation formula of all light-transmitting targets in S32 is:
[0050]
[0051] in, is the total set of all translucent targets, is the complete set of translucent objects in the nth image, N is the number of images in the image sequence, 1≤n≤N;
[0052] The position index relationship corresponding to each translucent target object,
[0053]
[0054] Among them, j represents the total set The jth element in n j To align the nth image in the target image sequence j Zhang Tu, For the Translucent targets, 1≤n j ≤ N, Representative Complete Works The number of elements in .
[0055] As an optimization, the calculation formula for the center point coordinates of each halo target object in the total set of halo targets in S33 is:
[0056]
[0057] in, is the total set of all halo targets The center point coordinates of all targets in , For the total set The horizontal coordinate of the center point of the h-th halo object, For nth h Zhang Tudi The horizontal coordinate of the upper left corner of the halo target object, For nth h Zhang Tudi The horizontal coordinate of the lower right corner of the halo target object, For the total set The ordinate of the center point of the hth halo object, For nth h Zhang Tudi The ordinate of the upper left corner of the halo target object, For nth h Zhang Tudi The vertical coordinate of the lower right corner point of the halo target object...;
[0058] The calculation formula for the center point coordinates of each translucent target object in the total set of translucent targets in S33 is:
[0059]
[0060] in, is the total set of all translucent targets The center point coordinates of all targets in , For the total set The horizontal coordinate of the center point of the jth light-transmitting target, For nth j The first picture The horizontal coordinate of the upper left corner of the translucent target object, For nth j The first picture The horizontal coordinate of the lower right corner of the translucent target object,
[0061] For the total set The ordinate of the center point of the jth light-transmitting target, For nth j The first picture The ordinate of the upper left corner of a translucent target object, For nth j The first picture The ordinate of the lower right corner of a translucent target object.
[0062] As an optimization, the specific steps of separating the total set of halo targets into multiple halo target subsets in S34 are:
[0063] Initialize halo subset 1≤k≤Number, when k=1, let For 1≤k≤Number, loop the following process in sequence:
[0064] a) Initialize the first element of the halo target subset
[0065] Initialize the kth subset The first element of is Coming soon The first element of is added to the halo subset in, become The first element of Set as Right now
[0066] b) Determine the correspondence between the halo subset and position index of the halo target entering the current cycle
[0067] set up Recorded as The tth element of Recorded as The number of elements in the halo set h (k,t) Elements are one-to-one equivalent, that is Set as the corresponding relationship of equal element position index, and according to S31, there is The first picture Halo target with It is a one-to-one correspondence relationship, that is, comprehensive Right now
[0068]
[0069] Then the position index relationship of the same element in different sets is set as so
[0070]
[0071] Right now The tth element of No.h (k,t) elements, and h (k,t) elements, you can find the corresponding and The position index corresponds to the following relationship:
[0072]
[0073] Right now The tth element of Zhang Tudi Each halo target is a one-to-one equal relationship;
[0074] According to S33 The center point coordinates If the following conditions are met:
[0075]
[0076]
[0077] but Add to subset In the example, the setting is recorded as
[0078]
[0079] Assume that The g-th element of the k-th halo subset can be found by setting it as n (k,g) and That is, with the nth (k,g) The first picture The halo targets are correspondingly equal, that is
[0080]
[0081] in, Represents the nth(k,g) The first picture The horizontal coordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The horizontal coordinate of the lower right corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the lower right corner of the halo target;
[0082] Therefore, the gth element of the kth halo subset has the same position index relationship as the halo target object in the image sequence diagram, denoted as g The number of elements of is set as
[0083] c) Calculate the set of remaining halo targets, and set the set of remaining halo targets as in That is, the full set is expressed as
[0084]
[0085] but The number of targets with halo is
[0086] As an optimization, the specific steps of S35 are:
[0087] Number of halo subsets constructed from S34 1≤k≤Number, the gth element of the kth subset The area is set as The area calculation formula is recorded as
[0088]
[0089] in, Represents the nth (k,g) The first picture The horizontal coordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The horizontal coordinate of the lower right corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the lower right corner of the halo target;
[0090] Find the index of the position with the largest area in each halo subset and set it as Right now
[0091]
[0092] in, Represents the kth subset The number of elements in the set, argmax represents the index of the position with the largest area in the calculation set, that is, the kth subset No. The area of the element is the largest. According to the position correspondence,
[0093]
[0094] but
[0095] in,
[0096] Representative The first picture The horizontal coordinate of the upper left corner of the halo target, Representative The first picture The ordinate of the upper left corner of the halo target, Representative The first picture The horizontal coordinate of the lower right corner of the halo target, Representative The first picture The vertical coordinate of the lower right corner of the halo target.
[0097] As an optimization, the specific steps of S36 are:
[0098] The halo target with the largest area for each halo subset obtained for S35 1≤k≤number, for all original translucent targets If the center point of the jth target object, If satisfied
[0099]
[0100]
[0101] That is, if the coordinates of the center point exist Inside, then Add to subset In the example, the setting is expressed as
[0102] set up The lth element target of No. (k,l) The element targets are one-to-one corresponding and equal, so the position index of the same target object is recorded as According to S32 The jth element of can find the corresponding n j and The position index of the same target is recorded as so The lth element target and the Zhang Tudi The element targets are correspondingly equal, and their position index relationship is recorded as
[0103]
[0104] so
[0105]
[0106] in, Representative Zhang Tudi The horizontal coordinate of the upper left corner of the translucent target object, Representative Zhang Tudi The ordinate of the upper left corner of a translucent target object, Representative Zhang Tudi The horizontal coordinate of the lower right corner of the translucent target object, Representative Zhang Tudi The ordinate of the lower right corner of a translucent target object.
[0107] As an optimization, the specific steps of S37 are:
[0108] Number of transparent target subsets constructed based on S36 1≤k≤Number, the lth element of the kth subset The area setting is recorded as area (sub,src,k,l) The area calculation formula is recorded as
[0109]
[0110] in, Representative Zhang Tudi The horizontal coordinate of the upper left corner of the translucent target object, Representative Zhang Tudi The ordinate of the upper left corner of a translucent target object, Representative Zhang Tudi The horizontal coordinate of the lower right corner of the translucent target object, Representative Zhang Tudi The ordinate of the lower right corner of a translucent target object;
[0111] Get the position index with the smallest area in each transparent target subset and set it as Right now
[0112]
[0113] in, Represents the kth subset The number of elements in the set, argmin represents the position index with the smallest area in the calculation set, that is, the kth subset No. The area of the elements is the smallest. According to the position correspondence,
[0114]
[0115] in,
[0116] Representative Zhang Tudi The horizontal coordinate of the upper left corner of the translucent target object, Representative Zhang Tudi The ordinate of the upper left corner of a translucent target object, Representative Zhang Tudi The horizontal coordinate of the lower right corner of the translucent target object, Representative Zhang Tudi The ordinate of the lower right corner of a translucent target object.
[0117] As an optimization, the specific steps of S4 are:
[0118] Use the coordinate position of the halo target with the largest area to intercept the corresponding position area of the light-transmitting target with the smallest area, and obtain the region of interest of the light-transmitting element target with the smallest area. That is, for any 1≤k≤number, according to S35, for each halo target subset, the target with the largest area has been obtained. According to S37, the smallest target area has been obtained for each light-transmitting target subset. The area of each image in the aligned image sequence imgs Replace with Area of the picture Get a new image sequence, set it as
[0119]
[0120] in, Represents the image img n The image after replacing the region of interest, that is, the image img n Center coordinate position The area is replaced by Zhang Tu The area is 1≤k≤number,1≤n≤N.
[0121] A depth of field superposition device comprises a processor and a memory, wherein the processor implements the above-mentioned method for removing halo interference by superposing the depth of field of a translucent target object when executing a computer program stored in the memory.
[0122] A computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the above-mentioned method for superimposing depth of field of a translucent target object for removing halo interference.
[0123] The beneficial effects of the present invention are:
[0124] The present invention provides a method and device for superimposing depth of field of a translucent target object for removing halo interference, which is mainly aimed at the special scene of a translucent target object under a phase contrast microscope. The method comprises the following steps: S1: obtaining an alignment target image sequence, collecting a plurality of target images with different depths of field under the same field of view of the microscope, obtaining a target image sequence, and obtaining an alignment target image sequence after an alignment operation, wherein the target images include a halo target object and a translucent target object; S2: detecting the coordinate position of the target object, using an artificial intelligence target detection algorithm to detect the coordinate position of the halo target object and the translucent target object in each image of the alignment target image sequence, obtaining the position information of the halo target object and the translucent target object, obtaining the full set of halo targets and the full set of translucent targets in each image, and obtaining the halo target object in each image of the alignment target image sequence. The sum of the number of the target and the number of the translucent target is equal; S3: Detect the halo target generated by the same translucent target in the alignment target image sequence, obtain the area at the position coordinates of the halo target with the largest area and the corresponding relationship between its position index and the area at the position coordinates of the translucent target with the smallest area and the corresponding relationship between its position index; S4: Replace the area of interest at the coordinates in all images in the alignment target image sequence with the area of interest of the translucent target with the smallest area, and obtain the image sequence after replacing the area of interest; the coordinate position of the area of interest of the translucent target with the smallest area uses the corresponding coordinate position of the halo target with the largest area; S5: Perform depth of field superposition using the image sequence after replacing the area of interest, and obtain the final target image with the halo removed and restored to the original image. The present invention removes the halo of the translucent target in a sequence of several microscopic images and restores it to the original image through the above method, so as to improve the imaging effect of depth of field superposition, reduce the addition of invalid information, more effectively reflect the characteristics of the original target, and provide guarantee for the subsequent observation and detection of the target. BRIEF DESCRIPTION OF THE DRAWINGS
[0125] The following is a further description of a method and device for removing halo interference from a translucent target object depth of field superposition, in conjunction with the accompanying drawings:
[0126] Figure 1 It is a schematic flow chart of the whole process of the present invention;
[0127] Figure 2 A schematic diagram of a process for detecting halo targets generated by the same translucent target in the alignment target image sequence, and obtaining a region at the position coordinates of the halo target with the largest area and a corresponding relationship between its position index and a region at the position coordinates of the translucent target with the smallest area and a corresponding relationship between its position index in some embodiments of the present invention;
[0128] Figure 3 An example diagram of an image sequence collected in the same field of view in some embodiments of the present invention;
[0129] Figure 4 An example diagram of an image sequence acquired after alignment operation in some embodiments of the present invention;
[0130] Figure 5 This is an example diagram of detecting a translucent target and a halo target by aligning the first image of the image sequence in some embodiments of the present invention;
[0131] Figure 6 This is an example diagram of detecting a translucent target and a halo target by aligning the second image of the image sequence in some embodiments of the present invention;
[0132] Figure 7 This is an example diagram of detecting a light-transmitting target and a halo target by aligning the third image of the image sequence in some embodiments of the present invention;
[0133] Figure 8 An example diagram of replacing the region of interest with the first image in the aligned image sequence in some embodiments of the present invention;
[0134] Fig. 9 An example diagram of replacing the region of interest with the second image in the aligned image sequence in some embodiments of the present invention;
[0135] Fig.10 This is an example diagram of replacing the region of interest with the third image in the aligned image sequence in some embodiments of the present invention;
[0136] Fig.11 This is an example diagram of the result of aligning the original image of the first image in the image sequence and replacing the region of interest in some embodiments of the present invention;
[0137] Fig.12 An example diagram of the original image of the second image in the aligned image sequence and the result after replacing the region of interest in some implementation modes of the present invention;
[0138] Fig.13 An example diagram of the original image of the third image in the aligned image sequence and the result after replacing the region of interest in some implementation modes of the present invention;
[0139] Fig.14 An example diagram of depth-of-field superposition of an original image sequence and magnified display of an area of interest thereof in some embodiments of the present invention;
[0140] Fig.15 An example diagram of depth of field superposition and magnified display of the region of interest using an image sequence after replacing the region of interest in some embodiments of the present invention;
[0141] Fig.16 An example diagram of contrast and enlargement of a region of interest 1 in some embodiments of the present invention;
[0142] Fig.17 An example diagram of contrast and magnification of a region of interest 3 in some embodiments of the present invention;
[0143] Fig.18 Schematic diagram of the structure of a depth of field superposition device in some implementation modes of the present invention. DETAILED DESCRIPTION
[0144] The present application is further described in detail below in conjunction with the accompanying drawings and implementation methods. It is particularly noted that the following implementation methods are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following implementation methods are only some implementation methods of the present application rather than all implementation methods. All other implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0145] This embodiment provides a method for removing halo interference from a translucent target object depth of field superposition, see Figure 1 and Figure 2 , specifically including the following steps:
[0146] Step 1: Obtain the alignment target image sequence: Collect image sequences with different depths of field and focal lengths under the same field of view of the microscope. Collect image sequences with different focal lengths and equal image resolution under the same field of view. The image sequence has 3 images, which are set as images = {image1, image2, image3}, such as Figure 3 As shown, the resolution of the image is 1200×1600, the height of the image is 1200, and the width of the image is 1600.
[0147] Alignment of image sequences. Enhanced correlation analysis parameter maximization algorithm is used for image alignment. The image sequence after image alignment is set as imgs = {img1, img2, img3}, such as Figure 4 shown.
[0148] Step 2: Detect the coordinate position of the target object: Use the artificial intelligence target detection algorithm to detect the coordinate position of the halo target object and the coordinate position of the light-transmitting target object in each image of the aligned image sequence. Construct a training set for detecting halo targets and light-transmitting targets, train the artificial intelligence detection model, and use the detection model to detect the halo targets and their corresponding light-transmitting targets in the aligned image sequence imgs. The first image img1 of the image sequence imgs is detected Halo targets and A light-transmitting target, such as Figure 5 As shown, the coordinates of the halo target detected by the artificial intelligence model for the first image img1 are:
[0149]
[0150]
[0151] Then the complete set of halo targets in the first image is
[0152] The coordinates of the translucent target detected by the artificial intelligence model for the first image img1 are
[0153]
[0154] Then the full set of translucent objects in the first image is
[0155] The second image img2 in the image sequence imgs is detected Halo targets and A light-transmitting target, such as Figure 6 As shown, the coordinates of the translucent target detected by the artificial intelligence model for the second image img2 are:
[0156]
[0157]
[0158]
[0159] Then the full set of halo targets in the second image is
[0160] The full set of translucent targets in the second image is
[0161] The third image img3 in the image sequence imgs is detected Halo targets and A light-transmitting target, such as Figure 7 As shown, the coordinates of the halo target detected by the artificial intelligence model for the third image img3 are:
[0162]
[0163] Then the complete set of halo targets in the third picture is
[0164] The coordinates of the translucent target detected by the artificial intelligence model for the third image img3 are
[0165]
[0166]
[0167] Then the complete set of translucent objects in the third picture is
[0168]
[0169] The sum of the number of halo objects and translucent objects in each image is 3.
[0170] Step 3: Union the full set of halo objects in each image in step 2 to generate the total set of all halo objects, and obtain the position index relationship corresponding to each halo object. is the union of all halo objects in the aligned image sequence, i.e.
[0171]
[0172] The number of elements in the full set is 3, and The relationship between the corresponding position indexes of the same elements is:
[0173]
[0174] Step 4: Combine all the sets of translucent objects in each image in step 2 to generate a total set of all translucent objects, and obtain the position index relationship corresponding to each translucent object. is the union of all transparent objects in the aligned image sequence, that is,
[0175]
[0176] The number of elements in the full set is 6, and The relationship between the corresponding position indexes of the same elements is:
[0177]
[0178] Step 5: Calculate the center point coordinates of each halo target in the total set of halo targets in step 3 and the center point coordinates of each translucent target in the total set of translucent targets in step 4. Set Halo Complete Works The center point coordinates of all targets in
[0179]
[0180]
[0181]
[0182] Set Collection Record as complete set The center point coordinates of all objects in .
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189] Step 6: Separate the total set of halo targets in step 3 into multiple halo target subsets, obtain the corresponding relationship between the position indexes of the elements in each halo target subset, and satisfy the requirement that the elements in the same subset are related, and the elements in different subsets are not related. Separate into Number = 3 subsets, set as represents the kth subset, 1≤k≤3, the intersection of any two different halo subsets is an empty set, that is, they are irrelevant. According to this step, we can get
[0190]
[0191]
[0192]
[0193] The number of each halo subset is
[0194] The corresponding relationship for the position index of the elements in the first subset is:
[0195]
[0196] The corresponding relationship for the position index of the elements in the second subset is:
[0197]
[0198] The corresponding relationship for the position index of the elements in the third subset is:
[0199]
[0200] Step 7: Obtain the correspondence between the halo target with the largest area and its position index in each halo target subset by comparing and calculating the center point coordinates of the halo target in step 5. Separate into 3 subsets. Since each subset happens to have only one element, this element is the element with the largest corresponding area.
[0201] The first halo subset No. The area of the element is the largest, and the corresponding element is Second halo subset No. The area of the element is the largest, and the corresponding element is The third halo subset No. The area of the element is the largest, and the corresponding element is That is, the corresponding relationship between the position index of the element with the largest area in each subset is
[0202]
[0203]
[0204]
[0205] Step 8: Construct the original light-transmitting target subset corresponding to the halo target with the largest area in each halo target subset in step 7. According to step 6, the element with the largest area in the first halo subset is
[0206]
[0207] Complete Collection The center point coordinates of all targets in The fourth element of
[0208]
[0209] Satisfies 0<20<65, 837<888<945, and but Enter the first original light-transmitting target subset; the fifth element
[0210]
[0211] Satisfies 0<19<65, 837<887<945, and but Enter the first original light-transmitting target subset, so the first original light-transmitting target subset is
[0212] The element with the largest area in the second halo subset is
[0213]
[0214] Complete Collection The center point coordinates of all targets in The third element of
[0215]
[0216] Satisfies 784<807<833, 73<99<123, and but Enter the second original light-transmitting target subset; the sixth element
[0217]
[0218] Satisfies 784<807<833, 73<99<123, and but Enter the second original light-transmitting target subset, so the second original light-transmitting target subset is
[0219] The element with the largest area in the third halo subset is
[0220]
[0221] Complete Collection The center point coordinates of all targets in The first element of
[0222]
[0223] Satisfies 252<286<328, 169<209<245, and but Enter the third original light-transmitting target subset; the second element
[0224]
[0225] Satisfies 252<287<328, 169<210<245, and but Enter the third original light-transmitting target subset, so the third original light-transmitting target subset is
[0226] Step 9: Obtain the corresponding relationship between the smallest transparent target and its position index in each original transparent target subset by comparing the coordinates of the center points of the transparent targets in step 5. Obtain the first transparent target subset according to step 8
[0227]
[0228] area(sub,src,1,1)=(40-0)×(908-868)=1600
[0229] area(sub,src,1,2)=(38-0)×(908-867)=1558
[0230] Obviously the second element has the smallest area. The corresponding element is
[0231] Second subset of translucent objects
[0232] area(sub,src,2,1)=(814-800)×(107-91)=224
[0233] area(sub,src,2,2)=(814-800)×(106-92)=196
[0234] Obviously the second element has the smallest area. The corresponding element is
[0235] The third subset of translucent objects
[0236] area(sub,src,3,1)=(300-273)×(224-195)=783
[0237] area(sub,src,3,2)=(301-273)×(226-195)=868
[0238] Obviously the first element has the smallest area. The corresponding element is
[0239] Step 10: Replace the region of interest at the coordinates in all images in the aligned target image sequence with the region of interest of the smallest translucent target object to obtain an image sequence after replacing the region of interest; the coordinate position of the region of interest of the smallest translucent target object uses the coordinate position of the corresponding halo target object with the largest area.
[0240] The element with the largest area in the first halo subset obtained according to step 7 is The element with the smallest area of the first subset of translucent targets obtained in step nine is That is, it corresponds to the third image in the aligned image sequence; the element with the largest area in the second halo subset is The element with the smallest area of the second subset of translucent targets obtained in step nine is That is, it corresponds to the third image in the aligned image sequence; the element with the largest area in the third halo subset is The element with the smallest area of the third subset of translucent targets obtained in step nine is Corresponding to the first image in the aligned image sequence;
[0241] Align each image img1, img2, img3 in the image sequence imgs and The areas at the coordinate positions are replaced with the third picture The area at the coordinate position, the third picture The area at the coordinate position, the first picture The area at the coordinate position is as follows Figure 8 , Fig. 9 , Fig.10 As shown. The image sequence after replacing the effective area, the result after replacing the area of interest in img1 is like Fig.11 As shown; the result after replacing the region of interest in img2 is like Fig.12 As shown; the result after replacing the region of interest in img3 is like Fig.13 As shown,
[0242] Step 11: Use the image sequence after replacing the region of interest to perform depth of field superposition to obtain the final target image that removes the halo and restores the original image. Use Laplace pyramid decomposition or wavelet decomposition to decompose the image sequence imgs obtained in step 10 ( final ) Perform depth of field stacking to obtain the final depth of field stacking result, which is set as focus_stacking_image, such as Fig.15 As shown, it is the result of depth of field superposition of the present invention.
[0243] The result after depth superposition of the original image sequence is as follows: Fig.14 As shown, the depth of field superposition result of the present invention is compared as shown in Fig.15 As shown. Fig.14 and Fig.15 The details of 1 are enlarged and compared, such as Fig.16 As shown, obviously, Fig.14 The region of interest 1 has obvious traces of halo, while the present invention Fig.15 The image of interest 1 is smoother and clearer. Fig.14 and Fig.15 The details of the 3 enlarged comparison pictures of interest are as follows Fig.17 As shown, similarly, Fig.14 The region of interest 3 has obvious traces of halo, and small black spots appear on the target object, affecting its original characteristics. Fig.15 The Interest 3 obviously removes the influence of halo and small black spots on the target, and clearly shows the original characteristics of the translucent target.
[0244] This embodiment provides a depth of field superposition device for microscope images, see Fig.18 , including a processor and a memory, wherein the processor implements the above-mentioned method of removing halo interference and depth of field superposition of a translucent target object when executing a computer program stored in the memory.
[0245] This embodiment provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned method for superimposing depth of field of a translucent target object for removing halo interference.
[0246] The present invention provides a method for removing halo interference from a translucent target object depth of field superposition, which removes the influence of halo and small black spots on the translucent target objects in a sequence of several microscopic images, clearly displays the original characteristics of the translucent target objects, improves the imaging effect of depth of field superposition, reduces the addition of invalid information, more effectively reflects the characteristics of the original target objects, and provides guarantee for subsequent observation and detection and inspection of the target objects.
[0247] The above description shows the main features, basic principles, and advantages of the present invention. For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments or examples, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, the above embodiments or examples should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended to include all changes within the meaning and scope of the equivalent elements of the claims in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the technical principle of the present invention shall fall within the scope of patent protection of the present invention.
Claims
1. A method for superimposing depth of field of a translucent target object to remove halo interference, characterized in that: The steps include: S1: Acquire an alignment target image sequence: collect a number of target images with different depths of field under the same field of view of the microscope to obtain a target image sequence. After the alignment operation, an alignment target image sequence is obtained, wherein the target images include halo targets and translucent targets; S2: Detecting the coordinate position of the target object: using an artificial intelligence target detection algorithm to detect the coordinate position of the halo target and the translucent target in each image of the aligned target image sequence, obtaining the position information of the halo target and the translucent target, and obtaining the full set of halo targets and the full set of translucent targets in each image, wherein the sum of the number of halo targets and translucent targets in each image of the aligned target image sequence is equal; S3: Detecting halo targets generated by the same translucent target in the alignment target image sequence, and obtaining a correspondence between an area at the position coordinates of the halo target with the largest area and its position index and a correspondence between an area at the position coordinates of the translucent target with the smallest area and its position index; S4: replacing the region of interest of the smallest light-transmitting target object with the region of interest at the coordinates of the smallest light-transmitting target object region in all images in the aligned target image sequence, to obtain an image sequence after the region of interest is replaced; the coordinate position of the smallest light-transmitting target object region of interest uses the coordinate position of the corresponding largest halo target object; S5: Perform depth of field superposition using the image sequence after replacing the region of interest to obtain a final target image that removes the halo and restores the original image.
2. A method for removing halo interference from a translucent target object depth of field superposition as claimed in claim 1, characterized in that: The S3 specifically includes the following steps: S31: Union the entire set of halo targets in each image in S2 to generate a total set of all halo targets, and obtain a position index relationship corresponding to each halo target; S32: Union the entire set of translucent objects in each image in S2 to generate a total set of all translucent objects, and obtain a position index relationship corresponding to each translucent object; S33: Calculating the center point coordinates of each halo target in the total set of halo targets in S31 and the center point coordinates of each translucent target in the total set of translucent targets in S32; S34: separating the total set of halo target objects in S31 into multiple halo target object subsets, and obtaining a corresponding relationship between position indexes of elements in each halo target object subset, wherein elements in the same halo target object subset are related, and elements between any two different halo target object subsets are not related; S35: obtaining the correspondence between the halo target with the largest area in each halo target subset and its position index by comparing and calculating the coordinates of the center points of the halo targets in S33; S36: constructing an original light-transmitting target object subset corresponding to the halo target with the largest area in each halo target object subset described in S35; S37: Obtain the corresponding relationship between the transparent target object with the smallest area in each original transparent target object subset and its position index through comparative calculation of the center point coordinates of the transparent target objects in S33.
3. A method for removing halo interference from a translucent target object depth of field superposition as claimed in claim 2, characterized in that: The total set calculation formula of all halo targets in S31 is: in, is the total set of all halo targets, is the complete set of halo targets in the nth image, N is the number of images in the alignment target image sequence, 1≤n≤N; The position index relationship corresponding to each halo target is: Among them, h represents the total set The hth element in n h Represents the nth image in the alignment target image sequence h Zhang Tu, For the Halo targets, 1≤n h ≤N, Representative Complete Works The number of elements in .
4. A method for removing halo interference from a translucent target object depth of field superposition as claimed in claim 3, characterized in that: The total set calculation formula of all light-transmitting targets in S32 is: in, is the total set of all translucent targets, is the complete set of translucent objects in the nth image, N is the number of images in the image sequence, 1≤n≤N; The position index relationship corresponding to each translucent target object, Among them, j represents the total set The jth element in n j To align the nth image in the target image sequence j Zhang Tu, For the Translucent targets, 1≤n j ≤N, Representative Complete Works The number of elements in .
5. A method for superimposing depth of field of a translucent target object to remove halo interference as claimed in claim 4, characterized in that: The calculation formula for the center point coordinates of each halo target object in the total set of halo targets in S33 is: in, is the total set of all halo targets The center point coordinates of all targets in , For the total set The horizontal coordinate of the center point of the h-th halo object, For nth h Zhang Tudi The horizontal coordinate of the upper left corner of the halo target object, For nth h Zhang Tudi The horizontal coordinate of the lower right corner of the halo target object, For the total set The ordinate of the center point of the hth halo object, For nth h Zhang Tudi The ordinate of the upper left corner of the halo target object, For nth h Zhang Tudi The ordinate of the lower right corner of the halo object; The calculation formula for the center point coordinates of each translucent target object in the total set of translucent targets in S33 is: in, is the total set of all translucent targets The center point coordinates of all targets in , For the total set The horizontal coordinate of the center point of the jth light-transmitting target, For nth j The first picture The horizontal coordinate of the upper left corner of the translucent target object, For nth j The first picture The horizontal coordinate of the lower right corner of the translucent target object, For the total set The ordinate of the center point of the jth light-transmitting target, For nth j The first picture The ordinate of the upper left corner of a translucent target object, For nth j The first picture The ordinate of the lower right corner of a translucent target object.
6. A method for superimposing depth of field of a translucent target object to remove halo interference as claimed in claim 5, characterized in that: The specific steps of separating the total set of halo target objects into multiple halo target object subsets in S34 are: Initialize halo subset 1≤k≤Number, when k=1, let For 1≤k≤Number, loop the following process in sequence: a) Initialize the first element of the halo target subset Initialize the kth subset The first element of is Coming Soon The first element of is added to the halo subset in, become The first element of Set as Right now b) Determine the correspondence between the halo subset and position index of the halo target entering the current cycle set up Recorded as The tth element of Recorded as The number of elements in the halo set h ( k,t ) Elements are one-to-one equivalent, that is Set as the corresponding relationship of equal element position index, and according to S31, there is The first picture Halo target with It is a one-to-one correspondence relationship, that is, comprehensive Right now Then the position index relationship of the same element in different sets is set as so Right now The tth element of No.h ( k,t ) elements, and h ( k,t ) elements, you can find the corresponding and The position index corresponds to the following relationship: Right now The tth element of Zhang Tudi Each halo target is a one-to-one equal relationship; According to S33 The center point coordinates If the following conditions are met: but Add to subset In the example, the setting is recorded as Assume that The g-th element of the k-th halo subset can be found by setting it as n (k,g) and That is, with the nth (k,g) The first picture The halo targets are correspondingly equal, that is in, Represents the nth (k,g) The first picture The horizontal coordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The horizontal coordinate of the lower right corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the lower right corner of the halo target; Therefore, the gth element of the kth halo subset has the same position index relationship as the halo target object in the image sequence diagram, which is recorded as The number of elements of is set as c) Calculate the set of remaining halo targets, and set the set of remaining halo targets as in , that is, the full set is expressed as but The number of targets with halo is 7. A method for superimposing depth of field of a translucent target object to remove halo interference as claimed in claim 6, characterized in that : The specific steps of S35 are: Number of halo subsets constructed from S34 1≤k≤Number, the gth element of the kth subset The area setting is recorded as area (sub,halo,k,g) The area calculation formula is recorded as in, Represents the nth (k,g) The first picture The horizontal coordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the upper left corner of the halo target, Represents the nth (k,g) The first picture The horizontal coordinate of the lower right corner of the halo target, Represents the nth (k,g) The first picture The ordinate of the lower right corner of the halo target; Find the index of the position with the largest area in each halo subset and set it as Right now in, Represents the kth subset The number of elements in the set, argmax represents the index of the position with the largest area in the calculation set, that is, the kth subset No. The area of the element is the largest. According to the position correspondence, but in, Representative The first picture The horizontal coordinate of the upper left corner of the halo target, Representative The first picture The ordinate of the upper left corner of the halo target, Representative The first picture The horizontal coordinate of the lower right corner of the halo target, Representative The first picture The vertical coordinate of the lower right corner of the halo target.
8. A method for removing halo interference from a translucent target object depth of field superposition as claimed in claim 7, characterized in that: The specific steps of S36 are: The halo target with the largest area for each halo subset obtained for S35 1≤k≤number, for all original translucent targets If the center point of the jth target object, If satisfied That is, if the coordinates of the center point exist Inside, then Add to subset In the example, the setting is expressed as set up The lth element target of No. (k,l) The element targets are one-to-one corresponding and equal, so the position index of the same target object is recorded as According to S32 The jth element of can find the corresponding n j and The position index of the same target is recorded as so The lth element target and the nth element j(k,l) Zhang Tudi The element targets are correspondingly equal, and their position index relationship is recorded as so in, Representative Zhang Tudi The horizontal coordinate of the upper left corner of the translucent target object, Representative Zhang Tudi The ordinate of the upper left corner of a translucent target object, Representative Zhang Tudi The horizontal coordinate of the lower right corner of the translucent target object, Representative Zhang Tudi The ordinate of the lower right corner of a translucent target object.
9. A method for removing halo interference from a translucent target object depth of field superposition as claimed in claim 2, characterized in that: The specific steps of S37 are: Number of transparent target subsets constructed based on S36 1≤k≤Number, the lth element of the kth subset The area setting is recorded as area (sub,src,k,l) The area calculation formula is recorded as in, Representative Zhang Tudi The horizontal coordinate of the upper left corner of the translucent target object, Representative Zhang Tudi The ordinate of the upper left corner of a translucent target object, Representative Zhang Tudi The horizontal coordinate of the lower right corner of the translucent target object, Representative Zhang Tudi The ordinate of the lower right corner of a translucent target object; Get the position index with the smallest area in each transparent target subset and set it as Right now in, Represents the kth subset The number of elements in the set, argmin represents the position index with the smallest area in the calculation set, that is, the kth subset No. The area of the elements is the smallest. According to the position correspondence, in, Representative Zhang Tudi The horizontal coordinate of the upper left corner of the translucent target object, Representative Zhang Tudi The ordinate of the upper left corner of a translucent target object, Representative Zhang Tudi The horizontal coordinate of the lower right corner of the translucent target object, Representative Zhang Tudi The ordinate of the lower right corner of a translucent target object.
10. A method for removing halo interference from a translucent target object depth of field superposition as claimed in claim 9, characterized in that: The specific steps of S4 are: Use the coordinate position of the halo target with the largest area to intercept the corresponding position area of the light-transmitting target with the smallest area, and obtain the region of interest of the light-transmitting element target with the smallest area. That is, for any 1≤k≤number, according to S35, for each halo target subset, the target with the largest area has been obtained. According to S37, the smallest target area has been obtained for each light-transmitting target subset. The area of each image in the aligned image sequence imgs Replace with Area of the picture Get a new image sequence, set it as in, Represents the image img n The image after replacing the region of interest, that is, the image img n Central coordinate position area Replace with Zhang Tu The area is 1≤k≤number, 1≤n≤N.
11. A depth of field superposition device, characterized in that: It comprises a processor and a memory, wherein when the processor executes the computer program stored in the memory, it implements the method for superimposing depth of field of a translucent target object for removing halo interference as described in any one of claims 1 to 10.
12. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, a method for superimposing depth of field of a translucent target object for removing halo interference as described in any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Image processing method and device and storage medium
CN111127358A
Image processing method and device, electronic equipment and storage medium
CN111192218A
Method for aperture synthesis imaging through multi-view shooting
CN102968784A
An imaging system using a lens unit with longitudinal chromatic aberrations and a method of operating
CN103430551A
Image processing method for removing Newton's halo
CN108428218A
