A method and apparatus for stitching microscope images
By combining encoders and generators, and utilizing GPU acceleration and light source correction technology, the microscope image stitching method solves the problems of high computational cost and low accuracy, achieving fast and high-precision image stitching, which is suitable for large-sized microscope images with high feature similarity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU INST OF BIOMEDICAL ENG & TECH CHINESE ACADEMY OF SCI
- Filing Date
- 2024-12-23
- Publication Date
- 2026-05-05
AI Technical Summary
Existing microscope image stitching methods are computationally intensive and have low accuracy, especially for large images and tissue images with high feature similarity, which pose risks of misidentification and poor stitching accuracy.
A microscope image stitching method based on coding structure is adopted. Image features are extracted by encoder and accelerated by GPU. Combined with stage displacement coding information, the generator generates stitching results and performs image coding after light source correction. Network structures such as self-attention layer and residual connection are used to improve processing speed and accuracy.
It effectively reduces computational load, improves image stitching speed and accuracy, reduces errors caused by lighting differences, and ensures the clarity and accuracy of stitched images. It is suitable for large-sized microscope images with high feature similarity.
Smart Images

Figure CN119831833B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a method and apparatus for stitching microscope images. Background Technology
[0002] A microscope is an optical instrument used to magnify tiny objects, cellular structures, microorganisms, and other objects that cannot be directly observed with the naked eye. It is widely used in biology, medicine, materials science, chemistry, and other fields. However, when analyzing tissues at the microscopic scale, both clarity and field of view are required. While microscopes can meet the precision requirements, the field of view is correspondingly reduced. Therefore, it is necessary to use a microscope to scan and photograph the tissue to be analyzed, and then stitch the images together to obtain high-precision, large-scale tissue images.
[0003] Currently, there are two main methods for stitching microscope images: feature-based stitching and phase-based stitching. Feature-based stitching extracts corner features from two images, matches these features, calculates an affine transformation matrix based on the matching results, projects the image to be stitched onto the coordinate system of the reference image, and finally completes the stitching using a fusion algorithm. However, this feature calculation method is time-consuming, especially for large images taken with a microscope, where feature calculation consumes significant memory and time. Furthermore, the high morphological similarity of cells in tissue images poses a risk of misidentification for images with similar features, leading to incorrect stitching results. Phase-based stitching uses a Fast Fourier Transform (FFT) to process and superimpose the images to be stitched, then performs an Inverse Fourier Transform (IFT) to obtain the stitched image. However, this method has lower accuracy. Summary of the Invention
[0004] In view of this, the present invention provides a method and apparatus for stitching microscope images to solve the problems of high computational load and low accuracy in existing microscope image stitching methods.
[0005] In a first aspect, the present invention provides a method for stitching microscope images, the method comprising:
[0006] The image to be stitched is the image obtained when the target sample is photographed through a microscope, and the image to be stitched carries the stage position information corresponding to the time when the image was photographed.
[0007] The images to be stitched are input into a pre-built encoder for encoding, and the encoding results corresponding to the images to be stitched are obtained one by one.
[0008] The encoding results corresponding to the images to be stitched and the stage position information are input into a pre-built generator to generate the image stitching results.
[0009] This invention proposes a microscope image stitching method based on an encoding structure. Image features are extracted through an encoder; this step is accelerated using a GPU, effectively improving processing speed. Furthermore, incorporating stage displacement encoding information into the encoder or generator further reduces computational load and improves processing speed and stitching accuracy. Finally, the stitched image is generated by a generator. This microscope image stitching method is effective for microscope images that are large in size and have high feature similarity, enabling rapid image stitching with high accuracy, effectively avoiding the problems of long computation time and poor precision.
[0010] In one optional implementation, after acquiring the images to be stitched, the method further includes:
[0011] A light source correction algorithm is used to correct the light source of the images to be stitched. The corrected images are then used as input to the encoder.
[0012] In this embodiment, before encoding the images to be stitched, a gamma light source correction algorithm is used to correct for light source inhomogeneity. The corrected image can effectively eliminate light source inhomogeneity, improve the consistency of image brightness and contrast, and thus reduce errors caused by differences in illumination. This not only helps to enhance the overall image quality but also significantly improves the accuracy of image matching during the stitching process, ensuring the clarity and accuracy of the final synthesized image.
[0013] In one optional implementation, a light source correction algorithm is used to correct the light source of the images to be stitched, including:
[0014] Convert the images to be stitched to HSV format;
[0015] Extracting luminance components from HSV format images;
[0016] The illumination component is obtained by performing multi-scale Gaussian convolution based on the brightness component.
[0017] The illumination components are corrected using a preset function to obtain the corrected image to be stitched together.
[0018] In this embodiment, the gamma light source correction algorithm effectively eliminates the brightness difference caused by the non-uniformity of the light source in the image, making the brightness distribution of the image more uniform, thereby improving the overall visual effect of the image and effectively enhancing the quality of image stitching.
[0019] In one optional implementation, the preset function is:
[0020]
[0021] Where O(x,y) is the corrected pixel brightness value, F(x,y) is the pixel brightness value of the image to be stitched, and x and y are pixel coordinates. Where I(x,y) is the illumination component of the image to be stitched, and m is the average brightness of the illumination component.
[0022] In this embodiment, the gamma function is used to correct the illumination component, and the image is re-synthesized using the corrected brightness to obtain the image after light source correction. This correction method can non-linearly adjust the image brightness, accurately correct the brightness deviation caused by the non-uniformity of the light source, improve the visual balance of the image, and preserve image detail information, thereby effectively improving the overall quality of the stitched image.
[0023] In one alternative implementation, the pre-built encoder includes:
[0024] The self-attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are connected in sequence.
[0025] In this embodiment, the encoder structure can effectively extract deep features of the image, improving the stitching accuracy and quality.
[0026] In one alternative implementation, the pre-built generator includes:
[0027] The layers are connected in sequence: mask self-attention layer, third residual connection and normalization layer, decoding self-attention layer, fourth residual connection and normalization layer, feedforward network layer, and fifth residual connection and normalization layer.
[0028] In this embodiment, the generator structure can effectively enhance image detail restoration and improve stitching accuracy.
[0029] In a second aspect, the present invention provides a microscope image stitching device, the device comprising:
[0030] The acquisition module is used to acquire the image to be stitched. The image to be stitched is the image obtained when the target sample is photographed by a microscope, and the image to be stitched carries the stage position information corresponding to the time when the image was photographed.
[0031] The encoding module is used to input the images to be stitched into a pre-built encoder for encoding, and obtain the encoding results corresponding to the images to be stitched one by one;
[0032] The generation module is used to input the encoding results corresponding to the images to be stitched and the stage position information into a pre-built generator to generate the image stitching result.
[0033] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the microscope image stitching method of the first aspect or any corresponding embodiment described above.
[0034] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the microscope image stitching method of the first aspect or any corresponding embodiment described above.
[0035] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the microscope image stitching method of the first aspect or any corresponding embodiment described above.
[0036] It should be noted that the microscope image stitching device, computer equipment, computer-readable storage medium, and computer program product provided by this invention correspond to the microscope image stitching method described above. Therefore, regarding the beneficial effects of the microscope image stitching device, computer equipment, computer-readable storage medium, and computer program product, please refer to the description of the corresponding beneficial effects of the microscope image stitching method above, and will not be repeated here. Attached Figure Description
[0037] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0038] Figure 1 This is a schematic flowchart of a microscope image stitching method according to an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram of the original image scanned according to an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of a stitched image according to an embodiment of the present invention;
[0041] Figure 4 This is a schematic flowchart of another microscope image stitching method according to an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram of the corrected stitched image according to an embodiment of the present invention;
[0043] Figure 6 This is a schematic diagram showing the details of a stitched image according to an embodiment of the present invention;
[0044] Figure 7 This is a schematic diagram of the encoder structure according to an embodiment of the present invention;
[0045] Figure 8 This is a schematic diagram of the generator structure according to an embodiment of the present invention;
[0046] Figure 9 This is a structural block diagram of a microscope image stitching device according to an embodiment of the present invention;
[0047] Figure 10 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] According to an embodiment of the present invention, a method for stitching microscope images is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0050] This embodiment provides a microscope image stitching method, which can be executed by devices such as servers, terminals, and mobile terminals. Figure 1 This is a flowchart of a microscope image stitching method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0051] Step S101: Obtain the image to be stitched. The image to be stitched is the image obtained when the target sample is photographed with a microscope, and the image to be stitched carries the stage position information corresponding to the time when the image was photographed.
[0052] In this embodiment, the target sample can be scanned in an S-shape by controlling the microscope, and the position of the stage at each time the image is taken can be recorded, which is the stage position information.
[0053] Stage position information can include two-dimensional coordinate information. Since the microscope stage typically moves in a two-dimensional plane, the stage position information can be an (X,Y) coordinate pair representing the specific location of each image capture point during scanning. Additionally, the stage position information includes sequence encoding. If the microscope scans in an S-shape or other pattern, sequence encoding can be used to represent the order of each image capture point. For example, in an S-shaped scan, the encoding can be a sequence number indicating which position of the currently captured image is within the scan path. This method helps the encoder or generator further understand the image capture order and position, improving image stitching quality.
[0054] This embodiment also provides a shooting example, which is the original image obtained by scanning a resolution panel under bright field conditions. See details below. Figure 2 As shown.
[0055] Step S102: Input the images to be stitched into a pre-built encoder for encoding to obtain a one-to-one encoding result corresponding to the images to be stitched. The encoding result refers to the feature representation obtained after processing the images to be stitched by the encoder, that is, the image features extracted by the encoder.
[0056] The images to be stitched are input into a pre-built encoder, which transforms the image data into feature vectors or feature maps. These feature vectors or feature maps contain key information about the image, such as edges, shapes, textures, and colors. These encoding results help the encoder model understand the content of the image and provide feature information for subsequent stitching tasks.
[0057] The encoder structures used in this embodiment include, but are not limited to, convolutional neural network encoders, variational autoencoders, and Transformer encoders. Stage displacement encoding information is also loaded during encoder training, which can be used as part of the feature representation.
[0058] Step S103: Input the encoding results corresponding to the images to be stitched and the stage position information into the pre-built generator to generate the image stitching result.
[0059] The encoded result and the stage position information are fed into a pre-trained generator. The generator can include multiple layers of networks, such as masking self-attention layers and decoding self-attention layers, to process the image. Specifically, the masking self-attention layer selectively focuses on the image stitching region, while the decoding self-attention layer helps recover image details, ultimately yielding a complete stitched image. The stitched, complete resolution plate image is used as a reference. Figure 3 As shown.
[0060] The generator structures used in this embodiment include, but are not limited to, deconvolutional neural networks, attention mechanism decoders, variational autoencoder decoders, and Transformer decoders.
[0061] This invention proposes a microscope image stitching method based on an encoding structure. Image features are extracted through an encoder; this step is accelerated using a GPU, effectively improving processing speed. Furthermore, incorporating stage displacement encoding information into the encoder or generator further reduces computational load and improves processing speed and stitching accuracy. Finally, the stitched image is generated by a generator. This microscope image stitching method is effective for microscope images that are large in size and have high feature similarity, enabling rapid image stitching with high accuracy, effectively avoiding the problems of long computation time and poor precision.
[0062] In some alternative implementations, after acquiring the images to be stitched, the process further includes:
[0063] A light source correction algorithm is used to correct the light source of the images to be stitched. The corrected images are then used as input to the encoder.
[0064] Reference Figure 4 As shown, after obtaining the image to be stitched, the image is obtained. Figure 2 After selecting samples 1, 2, ..., n, the image can be corrected using a gamma light source correction algorithm. The corrected image is then input into a pre-trained encoder, which encodes the images to be stitched together. The encoded results, along with the sample position codes, are then input into the generator to obtain the complete image of the stitched target samples. The complete image obtained after light source correction is shown in the reference image. Figure 5 As shown.
[0065] In this embodiment, before encoding the images to be stitched, a gamma light source correction algorithm is used to correct the light source non-uniformity. The corrected image can effectively eliminate the non-uniformity of the light source, improve the consistency of image brightness and contrast, and thus reduce errors caused by differences in illumination. This not only helps to enhance the overall image quality, but also significantly improves the accuracy of image matching during the stitching process, ensuring the clarity and accuracy of the final synthesized image.
[0066] In some optional implementations, a light source correction algorithm is used to correct the light source of the images to be stitched, including:
[0067] Convert the images to be stitched to HSV format.
[0068] Luminance component extraction based on HSV format image.
[0069] The illumination component is obtained by performing multi-scale Gaussian convolution based on the brightness component.
[0070] The illumination components are corrected using a preset function to obtain the corrected image to be stitched together.
[0071] Specifically, the images to be stitched are first converted from RGB format to HSV (Hue, Saturation, Luminance) format. The luminance component in HSV format can be processed more easily and independently of color information, facilitating brightness and light source correction. Further, to extract the illumination information of the image to be stitched—that is, illumination variation information unrelated to the image content—multi-scale Gaussian convolution can be used to process the luminance component. Gaussian convolution effectively removes detail information from the image by smoothing it, retaining only the illumination component. After multi-scale Gaussian convolution processing, the illumination component is obtained, representing the illumination intensity of each pixel in the image and reflecting the global illumination non-uniformity. Finally, a two-dimensional gamma function is used to correct the illumination component, correcting the brightness deviation caused by illumination non-uniformity.
[0072] In this embodiment, the gamma light source correction algorithm effectively eliminates brightness differences caused by uneven light source in the image, making the brightness distribution of the image more uniform, thereby improving the overall visual effect of the image and effectively enhancing the quality of image stitching. The stitching details are as follows: Figure 6 As shown, the edges selected from the stitching of four images show no pixel misalignment or deformation.
[0073] In some optional implementations, the preset function is:
[0074]
[0075] Where O(x,y) is the corrected pixel brightness value, F(x,y) is the pixel brightness value of the image to be stitched, and x and y are pixel coordinates. Where I(x,y) is the illumination component of the image to be stitched, and m is the average brightness of the illumination component.
[0076] In this embodiment, the gamma function is used to correct the illumination component, and the image is re-synthesized using the corrected brightness to obtain the image after light source correction. This correction method can non-linearly adjust the image brightness, accurately correct the brightness deviation caused by the non-uniformity of the light source, improve the visual balance of the image, and preserve image detail information, thereby effectively improving the overall quality of the stitched image.
[0077] In some alternative implementations, the pre-built encoder includes:
[0078] The self-attention layer, the first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are connected in sequence.
[0079] This embodiment provides a specific encoder structure, referring to... Figure 7 As shown in the diagram, the self-attention layer captures long-range dependencies in the image, ensuring visual consistency in the stitched areas and reducing inconsistencies at the boundaries. Residual connections and normalization layers help the model better propagate gradients, avoiding the vanishing gradient problem during training, thereby improving the stability and detail reproduction of the stitching effect. This encoder structure effectively extracts deep features from the image, enhancing stitching accuracy and quality.
[0080] In some alternative implementations, the pre-built generator includes:
[0081] The layers are connected in sequence: mask self-attention layer, third residual connection and normalization layer, decoding self-attention layer, fourth residual connection and normalization layer, feedforward network layer, and fifth residual connection and normalization layer.
[0082] The pre-training dataset for the encoder and generator can be selected from several different samples of microscopic images, including resolution plates under bright field, coding chips under fluorescence field, and tissue sections under fluorescence field. The number of scanning steps is set for each type of sample according to its size.
[0083] In this embodiment, a specific generator structure is provided, referring to... Figure 8 As shown in the diagram, the masked self-attention layer effectively focuses on the contextual information of the stitching region, ensuring seamless integration of image content and avoiding imperfections or unnatural seams at the stitching points. Through multiple residual connections and normalization layers, the generator optimizes gradient propagation, mitigating potential detail loss during training and ensuring the detail fidelity and global consistency of the stitched image. This generator structure effectively enhances image detail recovery and improves stitching accuracy.
[0084] This embodiment also provides a microscope image stitching device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0085] This embodiment provides a microscope image stitching device, such as... Figure 9 As shown, the device includes:
[0086] The acquisition module 201 is used to acquire the image to be stitched. The image to be stitched is an image obtained when the target sample is photographed by a microscope, and the image to be stitched carries the stage position information corresponding to the time when the image was photographed.
[0087] The encoding module 202 is used to input the image to be stitched into a pre-built encoder for encoding to obtain the encoding result corresponding to the image to be stitched; wherein, the pre-built encoder includes: a self-attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer connected in sequence.
[0088] The generation module 203 is used to input the encoding results corresponding to the images to be stitched and the stage position information into a pre-constructed generator to generate the image stitching result. The pre-constructed generator includes: a mask self-attention layer, a third residual connection and normalization layer, a decoding self-attention layer, a fourth residual connection and normalization layer, a feedforward network layer, and a fifth residual connection and normalization layer connected in sequence.
[0089] In some alternative implementations, the apparatus includes:
[0090] The correction module is used to correct the light source of the image to be stitched using a light source correction algorithm. The corrected image is then input into the encoder. This includes: converting the image to be stitched into an HSV format image; extracting the luminance component from the HSV format image; performing multi-scale Gaussian convolution on the luminance component to obtain the illumination component; and correcting the illumination component using a preset function to obtain the corrected image to be stitched.
[0091] The microscope image stitching device in this embodiment is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0092] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0093] This invention also provides a computer device having the above-described features. Figure 9 The microscope image stitching device shown.
[0094] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 10As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 10 Take a processor 10 as an example.
[0095] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0096] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0097] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0098] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0099] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0100] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0101] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0102] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for stitching microscope images, characterized in that, The method includes: The image to be stitched is obtained when the target sample is photographed using a microscope, and the image to be stitched carries the stage position information corresponding to the time the image was photographed; the stage position information includes: two-dimensional coordinate information and sequence encoding; A light source correction algorithm is used to correct the light source of the image to be stitched; including: converting the image to be stitched into an HSV format image; extracting the luminance component based on the HSV format image; performing multi-scale Gaussian convolution based on the luminance component to obtain the illumination component; and correcting the illumination component using a preset function to obtain the corrected image to be stitched. The image to be stitched after light source correction is input into a pre-built encoder for encoding to obtain a one-to-one encoding result corresponding to the image to be stitched; the pre-built encoder includes: a self-attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer connected in sequence. The encoding results corresponding to the images to be stitched one by one and the stage position information are input into a pre-built generator to generate image stitching results; the pre-built generator includes: a mask self-attention layer, a third residual connection and normalization layer, a decoding self-attention layer, a fourth residual connection and normalization layer, a feedforward network layer, and a fifth residual connection and normalization layer connected in sequence.
2. The method according to claim 1, characterized in that, The preset function is: in, For the corrected pixel brightness value, The pixel brightness values of the images to be stitched together, All are pixel coordinates. ,in, Let m be the illumination component of the image to be stitched, and m be the average brightness value of the illumination component.
3. A microscope image stitching device, characterized in that, The device includes: The acquisition module is used to acquire the image to be stitched, which is an image obtained when the target sample is photographed by a microscope, and the image to be stitched carries the stage position information corresponding to the time the image was photographed; the stage position information includes: two-dimensional coordinate information and sequence encoding; The correction module is used to perform light source correction on the image to be stitched using a light source correction algorithm; including: converting the image to be stitched into an HSV format image; extracting the luminance component based on the HSV format image; performing multi-scale Gaussian convolution based on the luminance component to obtain the illumination component; and correcting the illumination component using a preset function to obtain the corrected image to be stitched. The encoding module is used to input the image to be stitched after light source correction into a pre-built encoder for encoding, so as to obtain the encoding result corresponding to the image to be stitched; the pre-built encoder includes: a self-attention layer, a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer connected in sequence. The generation module is used to input the encoding results corresponding to the images to be stitched one by one and the position information of the stage into a pre-constructed generator to generate image stitching results; the pre-constructed generator includes: a mask self-attention layer, a third residual connection and normalization layer, a decoding self-attention layer, a fourth residual connection and normalization layer, a feedforward network layer, and a fifth residual connection and normalization layer connected in sequence.
4. A computer device, characterized in that, include: The system includes a memory and a processor, which are interconnected and the memory stores computer instructions. The processor executes the computer instructions to perform the microscope image stitching method according to claim 1 or 2.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the microscope image stitching method according to claim 1 or 2.
6. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the microscope image stitching method of claim 1 or 2.
Citation Information
Patent Citations
Neural network model based on attention mechanism
CN114462567A
Real-time microscopic image splicing method fusing position feedback
CN118229523A
Intelligent image splicing method based on deep learning and splicing system thereof
CN118608379A