Multi-threaded C++ implementation for Image Stitching.
In the Automated Medical Image Scanning, we have a significant issue with the moving camera position on the slide, thus the captured images is so likely to have overlapping fields with horizental and vertical adjacent images. We have developed a program in C++(due to its performance) which exports a DLL to be used in any project(an example for C# is under Stitching_CSHARP) to concat images regarding to the Matching Common Templates among adjacent overlapping images.
Row 7 : 8 - Columns 26 : 30:
-
Clone to the repository:
git clone https://github.com/AmirShahid/Stitching.git
-
Set Stitching/StitchConfig.json parameters as you want it can run on RAM to be faster. if you set load_from_disk you should address your data as said in the Data section.
-
Build the C++ Project to export a DLL including its dependencies like jpeg62.dll,opencv_imgproc343.dll, ...
(You can use it without exporting DLL in C++ projects like in Stitching/Main.cpp)
-
Put DLL files beside your project and whenever camera iterate a row in lamel call get_lr_shifts then save the output shifts
-
Finally when the whole lamel has been scanned call Stitch_all to get an array including the whole lamel image in diffrent zoom levels.
The output are the small non-overlapping tiles with diffrent details like google map tilesets and can be read through leaflet. the tiles in a specific zoom level can be concated to make a full lamel image. you can see a 40x40 output for 7 zoom leves here, this is a example for the top zoom level:
for more guidance you can see program.cs under Stitching_CSHARP.
We've made our own datasets with our Basler camera. you can add your dataset with setting data_dir parameter in StitchConfig.json and the images names can be like {pref}_{row_number}_{column_number}.{ext} where pref and ext should set through StitchConfig.
Please add an issue if you have any question