The sharpness and color of the stitched areas are noticeably different from the surrounding areas, and I’m not sure if there’s any way to improve this
Those look pretty good. I think that in order to improve them it is likely that you would need to understand what the AI driven code is doing.
There is also a large chance with just further prompting that the AI would make it look better by altering the overlap regions to smoothly merge one image into the next. This is what artistic or photographic merging often does, but it is problematic for scientific applications because it causes artefacts
The better news is that the OpenFlexure software already provides stitching, and takes z-stacked images. There is current development of stitching each of the z-stack planes rather than just the central one.
To debug this I would separate focus-stacking from stitching
This I think uses v2, where there is no built in stitching. Using the v3 beta release you will have built in stitching (or you can use the OpenFlexure Stitching package). This should be able to stitch your images reliably.
This means you need to get high quality focus-stacked images. I think the colour bleeding is from the focus-stacking. I assume there is some sort of colour normalisation applied in the code, it probably copied this from focus-stacking images that are non-specific to microscopy, where there is significantly less control of the colour than we have in a microscope, causing it to over-correct a problem that isn’t there.
It is also worth asking if those sample really have the focus depth that they need focus stacking?
If you do continue to develop focus stacking, then some other things you may need to worry about:
- The image appears to shift laterally during focus if the illumination is poorly aligned
- Changing focus can cause a scaling effect that may need to be addressed before stacking
I would take a z-stack, and then try to isolate the focus-stacking algorithm to get a good result. You can also feed the data into something like the StackFocuser plugin for ImageJ/FijI to see if your algorithm gives comparable results.
I think a combination of a robust focus stacking algorithm and the OpenFlexure Stitching package should give reliable results. It would be good to have a native focus stacking library for OpenFlexure
Thank you very much for your reply. My native language is not English, so I can only communicate with the help of translation software.
I am currently using version v3.0.0-beta1. This version comes with snake scan and raster scan, and it automatically stitches the scans together after scanning is complete. However, I am not very good at using the built-in panoramic scanning and stitching function: it does not seem to automatically identify the boundary of the specimen area, nor can it automatically scan the entire specimen (though this may also be because I do not know how to use it). Moreover, the results of the built-in panoramic stitching are not very different from my current approach; it also has the problem that the color at the seams differs from that of other areas, with marks at the stitching lines that look like “#” characters.I am currently using version v3.0.0-beta1. This version comes with snake scan and raster scan, and it automatically stitches the scans together after scanning is complete. However, I am not very good at using the built-in panoramic scanning and stitching function: it does not seem to automatically identify the boundary of the specimen area, nor can it automatically scan the entire specimen (though this may also be because I do not know how to use it). Moreover, the results of the built-in panoramic stitching are not very different from my current approach; it also has the problem that the color at the seams differs from that of other areas, with marks at the stitching lines that look like “#” characters.
By contrast, I find the plugin made by having AI program it more convenient: it can automatically identify the specimen boundary and scan automatically without any additional settings. The main problem now is that, after stitching, the color at the seams of the image differs from that of other areas.By contrast, I find the plugin made by having AI program it more convenient: it can automatically identify the specimen boundary and scan automatically without any additional settings. The main problem now is that, after stitching, the color at the seams of the image differs from that of other areas.
I later analyzed that the main cause of this problem may be hardware factors such as the camera and LED lighting: the center and the periphery of the image are inherently inconsistent in color and clarity, and even after correction it is difficult to solve this completely. Therefore, this problem is also relatively difficult to solve with a panoramic stitching program alone.I later analyzed that the main cause of this problem may be hardware factors such as the camera and LED lighting: the center and the periphery of the image are inherently inconsistent in color and clarity, and even after correction it is difficult to solve this completely. Therefore, this problem is also relatively difficult to solve with a panoramic stitching program alone.The image below was produced by the built-in panoramic scanning and stitching program. Even ignoring the stitching errors, there is still a fairly obvious color difference at the seams.
Do you not have a 3rd workflow called histoscan. This should automatically detect the edge of the sample
Thank you so much, my friend. I didn’t know how to use HistoScan before. It has many setting options, and I didn’t know how to configure them. Today I tried just clicking Scan directly, and I think the result is really good. The first image was generated by a direct scan with HistoScan, and the second and third images were generated by a program written by AI.







