How to create .pgm image from text file?
Afficher commentaires plus anciens
Hello
I have a .txt file in the following format(see attached file):
line 1: integer height
line 2: integer width
line 3: float ratio
line 4: int size
line 5: int start
line 6: int goal
The next lines from 7 to height must be stored in a matrix height*width
The matrix is matrix of integers ( 0s and 100s)
The 0s must be converted to white pixels(free spaces) while 100s must be converted to black pixels(obstacles), so the image is a map that can be used in robot navigations.
How can I read this file and convert the matrix into .pgm image file.
Thanks a lot in advance,
1 commentaire
Eman Almoaili
le 18 Nov 2020
Modifié(e) : Eman Almoaili
le 18 Nov 2020
Réponses (0)
Catégories
En savoir plus sur Import, Export, and Conversion dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!