From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

kl3m3n's blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Scale-invariant feature transform source code&DLL

Klemen
Active Participant

In one of my previous posts, I have been testing the openCV SIFT algorithm. I have cleaned and improved the code and used a couple of different input images. The results are shown below.

I am also attaching the source c++ code, the DLL and labview code that calls the DLL. For an image of VGA size (640x480 pixels) the SIFT algorithm takes about 500 ms (with my poor coding at least ). The modification to use SURF algorithm is then simple. Note that the algorithm uses default parameters that cannot be altered with the attached code. But again, to extend the code to be able to change the parameters is also simple. Code is compiled with VS2010 x86 and OpenCV 2.4.5. Add  "...\opencv\build\x86\vc10\bin" to system path or recompile the source code yourself.

1.png

2.png

3.png

4.png

Be creative.

Post edited on 30.8.2013

I saw that I have made some error in the previous code (the LV example program, where the u offset of the matched points was off - the wire "x image size" was connected from the wrong image). I have corrected this and updated the code so you can modify the parameters of the SIFT algorithm in Labview. The code also calculates the homography, which can be used to map the corresponding points from one image to another (see the image below). This can be used for object tracking.

sift_homography_openCV_FP.jpg

Note, that the dll was built with OpenCV 2.4.6 so you need to install it (and add to system path) or recompile the source code yourself. The LV example is attached also (version 2010).

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Comments