importing image

3 vues (au cours des 30 derniers jours)
Hassan
Hassan le 19 Avr 2011
I have a big 3-dimensional array (1500 rows, 500 columns, 4 bands) in band-sequential (BSQ)format. I tried Multibandread() function but it takes ages to read the data. Is there any faster way to import the data into Matlab? I appereciate your help.

Réponse acceptée

Jan
Jan le 20 Avr 2011
Did you try a simple FREAD?
FID = fopen(FileName, 'r');
if FID < 0; error('Cannot open file'); end
% Skip the header here...
Data = fread(FID, Inf, 'uint8=>uint8'); % Choose the correct format!
fclose(FID);
Data = reshape(Data, [500, 1500, 4]);
Data = permute(Data, [2, 1, 3]);
  1 commentaire
Hassan
Hassan le 21 Avr 2011
thanks a lot Jan.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Import, Export, and Conversion dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by