How to create .pgm image from text file?
Mostrar comentarios más antiguos
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 comentario
Eman Almoaili
el 18 de Nov. de 2020
Editada: Eman Almoaili
el 18 de Nov. de 2020
Respuestas (0)
Categorías
Más información sobre Import, Export, and Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!