Skip to content

Porting an algorithm from MATLAB to C for feature extraction from hyperspectral images using local covariance matrix representation with consequent parallelization using CUDA/OpenMP.

License

Notifications You must be signed in to change notification settings

domenico-rgs/LCMR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LCMR

Porting an algorithm from MATLAB to C for feature extraction from hyperspectral images using local covariance matrix representation with consequent parallelization using Cuda 10.2 and OpenMP.

Hyperspectral Remote Sensing Scenes (sample datasets): http://www.ehu.eus/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes

Used libraries

Parameters and data from Matlab

param.txt

n°_classes
windows_size
spectral_reflectance_bands
width height excepted_output_dimensionality final_no_bands
color_map [india, uni, center, dc]

HSI

hsi=reshape(permute(indian_pines_corrected, [1,2,3]),[],size(indian_pines_corrected,3))';
dlmwrite('hsi.txt',hsi,'delimiter',' ');

Groundtruth

labels=reshape(permute(labels, [1,3,2]),[],size(labels,2));
dlmwrite('labels.txt', labels,'delimiter',' ');

Serial execution

cd C
g++ -O2 -I ../eigen-lib/ demo.cpp demoFunctions.cpp fileHandler.cpp funLCMR.cpp funMyMNF.cpp BitmapWriter.cpp svm.cpp -lm
./a.out param.txt hsi.txt labels.txt

Parallel execution

Windows

Compile the source code in LCMR Parallel through Visual Studio (release mode) and then run as follow:

cd "\LCMR Parallel\x64\Release"
"LCMR Parallel.exe" param.txt hsi.txt labels.txt

About

Porting an algorithm from MATLAB to C for feature extraction from hyperspectral images using local covariance matrix representation with consequent parallelization using CUDA/OpenMP.

Topics

Resources

License

Stars

Watchers

Forks