How can I convert a XYZ format to an image format
Mostra commenti meno recenti
I have a text file with 3 columns; #ith pixel #jth pixel #Height of the (ith,jth) pixel in microns
(its basically a data for plotting the surface height from a camera)
How can I convert this to a gray scale image format so that I could use the Image Processing Toolbox?
Thanks, Shayan
Risposta accettata
Più risposte (2)
Ashish Uthama
il 12 Lug 2011
0 voti
What is the range and resolution of i's and j's? Can you scale these coordinates into integer values?
If you could scale them into a 1 to N and 1 to M range, you could create a matrix of NaN's/zeros/base height with size [N M] and then index into it with the i's and j's to populate the height values.
Pixel locations with no entry in your data file will remain at the initial value.
Shayan
il 12 Lug 2011
0 voti
1 Commento
Ashish Uthama
il 12 Lug 2011
If you have all your pixels in the vector form, as Walter suggested, using reshape might do the trick.
Please consider accepting Walter's answer if it works for you and staring another question for the cross correlation question.
Categorie
Scopri di più su Language Support in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!