Stitch Images: SIFT

Share your advanced PureBasic knowledge/code with the community.
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Stitch Images: SIFT

Post by JHPJHP »

-----------------------------------------------------------------------------------

Download Stitch Images: SIFT from My PureBasic Stuff

-----------------------------------------------------------------------------------

A standalone OpenCV application (PureBasic Interface to OpenCV not required).

-----------------------------------------------------------------------------------

Announcements
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB Image Steganography
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Chromium Edge WebGadget
IAccessible Interface
Stitch Images: SIFT
OldSkool Fire Effect
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Large Image Viewer
Barcode Generator
Google Translate Service
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management

-----------------------------------------------------------------------------------

NOTE: If there is enough interest, I'll write a user interface to access the myriad of available parameters.
- StitchImages_DLL.pb: execute numerous stitching examples from a DLL
- StitchImages_EXE.pb: execute numerous stitching examples from an EXE
- \scripts\CvMat\: contains the program files compiled to DLL / EXE (new version)
- \scripts\IplImage\: contains the program files compiled to DLL / EXE (old version)

-----------------------------------------------------------------------------------

If you're familiar with PureBasic Interface to OpenCV then this stitching technique won't be new, but the results will be.
In order to have a near seamless stitch, a Laplacian blending algorithm is applied during the stitch process.

The following examples from PureBasic Interface to OpenCV were the basis for this project.
- le_stitching_1.pb, le_stitching_2.pb, cv_laplacian_blending.pb
Last edited by JHPJHP on Sat Oct 16, 2021 8:56 pm, edited 19 times in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Stitch Images: SIFT

Post by JHPJHP »

Updated:
- improved parts of the code
- squashed a couple bugs
Last edited by JHPJHP on Wed Oct 16, 2019 3:38 pm, edited 3 times in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
BarryG
Addict
Addict
Posts: 1719
Joined: Thu Apr 18, 2019 8:17 am

Re: Stitch Images: SIFT

Post by BarryG »

Looks fantastic! Thanks for this. Amazing what you can do with PureBasic.
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Stitch Images: SIFT

Post by JHPJHP »

Hi BarryG,

You are most welcome, thank you for commenting.

---------------------------------

Updated:
- switched from IplImage to CvMat
- improved various parts of the code
- squashed a couple bugs

NB*: The IplImage version of the code can be found in the [ scripts ] folder.
Last edited by JHPJHP on Sun Oct 13, 2019 5:39 am, edited 1 time in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
BarryG
Addict
Addict
Posts: 1719
Joined: Thu Apr 18, 2019 8:17 am

Re: Stitch Images: SIFT

Post by BarryG »

I used to use a commercial product many years ago to do it, so it's impressive what you've done.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Stitch Images: SIFT

Post by djes »

So cool ! :D
davido
Addict
Addict
Posts: 1853
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Stitch Images: SIFT

Post by davido »

@JHPJHP,
Nice work.
Thank you, very much. :D
DE AA EB
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Stitch Images: SIFT

Post by JHPJHP »

Hi BarryG,
BarryG wrote:I used to use a commercial product many years ago to do it, so it's impressive what you've done.
The OpenCV framework and its contributors have done most of the heavy lifting, but thank you for your kind words.

---------------------------------

Hi djes, davido,

As always, I appreciate you taking the time to comment on the work I have done.

---------------------------------

Updated:
- fixed a memory issue

Memory Issue
I originally thought the problem was fixed using the Function FreeLibraryAndExitThread; taken from this post by Inf0Byt3.
I later realized that the size set for the image matrix was causing the memory issue.
Last edited by JHPJHP on Wed Oct 16, 2019 3:45 pm, edited 1 time in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Stitch Images: SIFT

Post by JHPJHP »

Re-Updated:
- added a sizing algorithm
- added cropping
- speed improvements
- added minimal error checking
- squashed a couple bugs

Sizing Algorithm
Large images have the potential to crash the program; images are resized if the total width / height exceeds a set limit.

NB*: The EXE and DLL can now be recompiled directly from the [ scripts ] folder.
- \scripts\CvMat\StitchImages_CvMat_DLL.pb
- \scripts\CvMat\StitchImages_CvMat_EXE.pb

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Stitch Images: SIFT

Post by JHPJHP »

Updated:
- bug fixes & minor code improvements

Stitched together 4 images...

Without Laplacian Blending / Cropping:
Image

With Laplacian Blending / Cropping:
Image

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
Post Reply